package com.jhc.common.core.web.page;

import com.jhc.common.core.enums.FilterType;
import com.jhc.common.core.utils.Null;
import lombok.Data;

import java.util.List;

@Data
public class PageFilter {
    private String column;

    private String value;

    private FilterType type;

    public static String buildWhere(List<PageFilter> filters){
        StringBuilder builder = new StringBuilder();
        if (Null.isEmpty(filters)){return null;}
        filters.forEach(filter -> FilterType.handle(builder,filter));
        return builder.toString();
    }
}
